package io.jee.medusa.firewall;

import org.springframework.stereotype.Repository;

import io.jee.medusa.orm.Hibernate5DaoSupport;

@Repository
public class FirewallActionCountDaoImpl extends Hibernate5DaoSupport<FirewallActionCount> implements FirewallActionCountDao {

	@Override
	public void deleteOverdue(int day) {
		String hql = "delete Firewall where time < :time";
		long time = System.currentTimeMillis() - (1000l*60*60*24*day);
		super.currentSession().createQuery(hql).setParameter("time", time).executeUpdate();
	}

}
